"""django2 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from test1 import views

#路由是从下往下的正则匹配式

#他满足正则匹配的公式

#为什么我们的Url结束的时候要加上 /

#正则匹配是不会精确度的 他只要匹配到了就会给交函数处理

# ?P<a1> 固定写法 表示把匹配到的参数传给view
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r"^test/", views.test1),
    url(r'^test2/', views.test2),
    url(r'^test3/', views.test3),
    url(r'^test4/', views.test4,name='test4'),
    url(r'^test5/\d+/', views.test5),
    # url(r'^test6/',views.test6)
    url(r'^classroom/(?P<class_id>\d+)/',views.test7,name='test7')
]

urlpatterns += [
    # r表示正则 ^ 表示以xxx开头 以test
    url(r'^example/', include('test1.urls')),
]

